package com.ehome.poct.base.dao.mapping;

import cn.hutool.json.JSONUtil;
import com.ehome.poct.base.api.dto.device.AddFactoryModeDTO;
import com.ehome.poct.base.dao.device.entity.TestBloodQualityFactoryDataDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * @author 瑶苏
 * @date 2021/08/23 16:09
 **/
@Mapper(componentModel = "spring", imports = {JSONUtil.class, AddFactoryModeDTO.class})
public interface FactoryModeMapping {
    @Mappings({
            @Mapping(source = "account", target = "loginName"),
            @Mapping(source = "sno", target = "deviceSno"),
            @Mapping(source = "result", target = "resultJson"),
            @Mapping(target = "createTime", ignore = true),
            @Mapping(target = "createBy", ignore = true),
            @Mapping(target = "updateTime", ignore = true),
            @Mapping(target = "updateBy", ignore = true),
            @Mapping(target = "delete",ignore = true)
    })
    TestBloodQualityFactoryDataDO to(AddFactoryModeDTO addFactoryModeDTO);
}